package orchestration.businessprocess.model.nodes;

import orchestration.businessprocess.model.BPNodeId;
import orchestration.businessprocess.model.IBPVisitor;

/**
 * A merge gateway has a set of predecessor and one successor
 * When the gateway is visited for the first time, we can directly
 * skip to the successor without waiting for all the predecessors to be visited
 * @author  <a href="mailto:car.ferrarini@gmail.com">Carlo Ferrarini</a>
 */
public class BPMergeGateway extends BPNode{

	/**
	 * @uml.property  name="next"
	 * @uml.associationEnd  
	 */
	private BPNode next;
	BPMergeGateway(BPNodeId id,BPNode next) {
		super(id,BPNode.NODE_TYPE_MGW,null,null);
		this.next=next;
	}

	public BPMergeGateway(BPNodeId id) {
		super(id,BPNode.NODE_TYPE_MGW,null,null);
	}

	@Override
	public void accept(IBPVisitor visitor) {
		visitor.visit(this);
	}
	/**
	 * @return
	 * @uml.property  name="next"
	 */
	public BPNode getNext(){
		return this.next;
	}
	/**
	 * @param next
	 * @uml.property  name="next"
	 */
	public void setNext(BPNode next) {
		this.next = next;
	}

}
